package com.gh.thread;

/**
 * @author hugx
 * @create 2018-10-24 10:41
 */
public class ProductTask implements Runnable {

    @Override
    public void run() {
        three();
    }

    private void one(){
        OrderManager.num= OrderManager.num +5;
        System.out.println(Thread.currentThread().getName()+"  , num: "+OrderManager.num);
    }

    private void two(){
        int k=OrderManager.num2.get().intValue() + 5;
        OrderManager.num2.set(k);
        System.out.println(Thread.currentThread().getName()+"  , num: "+OrderManager.num2.get());
    }

    private void three(){
        OrderManager.num ++;
        OrderVo orderVo=OrderManager.orderVoThreadLocal.get();
        orderVo.setNum(OrderManager.num);
        System.out.println(Thread.currentThread().getName()+"  , totalPrice: "+orderVo.getTotalPrice());
    }
}
